﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PhotoGallery.Core.Business;

namespace PhotoGallery.Modules.Authority.Model
{
    /// <summary>
    /// 模型角色搜索
    /// </summary>
    public class AccountRoleSearch
    {
        /// <summary>
        /// 用户姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public int? Gender { get; set; }


        public int? PageIndex { get; set; }

        public int? PageSize { get; set; }


        /// <summary>
        /// 
        /// </summary>
        public AccountRoleSearch()
        {
        }
        /// <summary>
        /// 
        /// </summary>
        public AccountRoleSearch(string name)
            : this()
        {
            this.Name = name;
        }


        public AccountRoleSearch(string name, int? gender)
            : this(name)
        {
            this.Gender = gender;
        }
    }


    public class AccountRoleIndexModel
    {
        /// <summary>
        ///  搜索条件
        /// </summary>
        public AccountRoleSearch Search { get; set; }

        public IList<Core.Business.Account> Accounts { get; set; }

        public AccountRoleIndexModel()
        {

        }

        public AccountRoleIndexModel(AccountRoleSearch search, IList<Core.Business.Account> accounts)
            : this()
        {
            this.Accounts = accounts;
            this.Search = search;
        }
    }


    public class AccountRoleEditModel
    {
        #region Field & Property

        public Core.Business.Account Account { get; set; }

        public HashSet<Operation> Operations { get; set; }

        public HashSet<Role> Roles { get; set; }

        #endregion


        #region Constructor

        public AccountRoleEditModel()
        {
            //
            this.Operations = new HashSet<Operation>();
        }

        public AccountRoleEditModel(Core.Business.Account account)
            : this()
        {
            this.Account = account;
        }

        public AccountRoleEditModel(Core.Business.Account account, HashSet<Operation> operations)
            : this(account)
        {
            this.Account = account;
            this.Operations = operations;
        }

            

        #endregion


    }
}
